Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request log mem leak #110

Merged
merged 4 commits into from
Dec 7, 2024
Merged

Request log mem leak #110

merged 4 commits into from
Dec 7, 2024

Conversation

ryanrdoherty
Copy link
Member

Writes all requests to temporary files, checks sizes and rejects request bodies that are too large. Then only logs body in service access log if response status code is 5xx, and even then truncates body to a reasonable level.

Possible enhancement would be to check max request size as we are writing to the file to save temp disk space and reject as soon as we go over the limit. Is it worth it?

@ryanrdoherty ryanrdoherty self-assigned this Dec 1, 2024
@Foxcapades
Copy link
Member

Possible enhancement would be to check max request size as we are writing to the file to save temp disk space and reject as soon as we go over the limit. Is it worth it?

We already have at least 2 implementations of streams that do exactly this if you wanted to port one/both of them to java:

  • InputStream - Throws customizable exception when more than N bytes are read.
  • OutputStream - Not the most efficient, currently throws bad request exception when attempting to write more than N bytes.

@ryanrdoherty ryanrdoherty merged commit 11fdaff into master Dec 7, 2024
1 check passed
@ryanrdoherty ryanrdoherty deleted the request-log-mem-leak branch December 7, 2024 05:09
@ryanrdoherty ryanrdoherty restored the request-log-mem-leak branch December 7, 2024 05:09
@ryanrdoherty ryanrdoherty deleted the request-log-mem-leak branch December 7, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants